package com.ganyu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ganyu.domain.dto.AdminRoleDto;
import com.ganyu.domain.dto.AdminUserDto;
import com.ganyu.domain.entity.Role;
import com.ganyu.domain.entity.User;
import com.ganyu.domain.vo.AdminAllRoleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 角色信息表(Role)表数据库访问层
 *
 * @author chenxi
 * @since 2022-09-28 09:59:41
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {
    //根据id查询角色名
    List<String> getRoleKeyById(@Param("id") Long id);

    //获取角色列表
    List<Role> getRoleList(@Param("pageNum")Integer pageNum,@Param("pageSize")Integer pageSize,@Param("roleName")String roleName,@Param("status")String status);

    //获取个数
    int getCount(@Param("roleName")String roleName,@Param("status")String status);

    //修改角色权限
    void changeStatus(@Param("roleId") Long roleId,@Param("status") String status);

    //添加角色
    void insertUser(AdminUserDto adminUserDto);

    //获取用户id
    Long getUserId(@Param("roleName") String roleName);
    //删除用户
    void deleteUserById(@Param("ids") Long[] ids);

    //查询正常状态的role
    List<AdminAllRoleVo> selectAllRole();

    //根据id查询所有信息
    Role selectRoleById(@Param("roleId")Long roleId);

    //获取所有role
    List<Role> getAllRole();

}

